home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12255 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: news.islandnet.com!usenet
  2. From: Abram Hindle <abehind@islandnet.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Newbie: How to put a byte to a000:0001 or more?
  5. Date: 30 Mar 1996 00:22:00 GMT
  6. Organization: Island Net in Victoria, B.C. Canada
  7. Message-ID: <4jhur8$995@sanjuan.islandnet.com>
  8. NNTP-Posting-Host: hornby.islandnet.com
  9.  
  10. Ok I'm a newbie to C and to Assembler.
  11.  I need help with finding out how in assembler or in c
  12. I can put (quickly) a byte in the a000:0000+ address to
  13. draw a pixel on the screen?
  14. I'm doing this on a IBM compatiable in VGA mode (13h)
  15. I've done something like so:
  16. void putpixel(int x, int y, char col)
  17. {
  18. unsigned int pos;
  19. pos=x+(y*319)
  20. asm {
  21.  
  22.     mov al,[col]/*al = colour*/
  23.     mov ax,[pos]/*ax = position*/
  24.     mov DI,ax /*move ax to di*/
  25.     mov ax,[VGA]/*copies 0a000h to ax i've defined it*/
  26.     mov es,ax /*moves that to es*/
  27.     mov [ES:DI],al  /*Put in Memory al(colour)*/
  28.  
  29.     }
  30. }
  31.  
  32. and it does nothing! So could you guys help? I really need it,
  33. BGIs are to slow and so is using int 10h.
  34. e-mail me at: abehind@islandnet.com
  35.  
  36.